let num = 120
var countDigits = function(num) {
    let arr = num.toString().split('')
    let result = 0
    for(let i=0;i<arr.length;i++){
        if(!(num%arr[i])){
            result++
        }
    }
    return result
};
console.log(countDigits(num));
